<template>

  <data-list
    :options="options"
    :list-query="listQuery"
  >

    <template slot="search-bar">

      <el-input
        v-model="listQuery.params.title"
        class="filter-item"
        placeholder="搜索公告"
        prefix-icon="el-icon-search"
      />

    </template>

    <template slot="list-item" slot-scope="scope">

      <el-card style="margin-top: -1px; font-size: 14px; border-radius:0px" shadow="never">
        <el-row type="flex" style="line-height: 28px">
          <el-col :span="24" :xs="24">
            <div style="font-weight: 700; font-size: 16px">
              <router-link :to="{ name: 'NoticeDetail', params: { id: scope.data.id }}"> {{ scope.data.title }}</router-link>
            </div>

            <div style="color: #666; font-size: 12px">
              <el-row>
                <el-col :span="8" :xs="12"><i class="el-icon-edit" />发布时间：{{ scope.data.createTime }}</el-col>
              </el-row>
            </div>
          </el-col>

        </el-row>

      </el-card>

    </template>

  </data-list>

</template>

<script>
import DataList from '@/components/DataList'

export default {
  components: { DataList },
  data() {
    return {

      listQuery: {
        current: 1,
        size: 10,
        params: {
          state: 0
        }
      },

      options: {
        multi: false,
        // 列表请求URL
        listUrl: '/api/sys/notice/paging'

      }
    }
  },

  methods: {

    handleDetail(id) {
      this.$router.push({ name: 'NoticeDetail', params: { id: id }})
    }
  }
}
</script>
